package br.com.amadeus.android.dao;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;

public class HistoryDAO {
	
	public static String[] columns = new String[] {HistoryDAO.ID, HistoryDAO.COURSE_ID,
		HistoryDAO.TASK_ID, HistoryDAO.USER_ID, HistoryDAO.CREATION_DATE};
	
	public static final String ID = "_id";
	public static final String COURSE_ID = "course_id";
	public static final String TASK_ID = "task_id";
	public static final String USER_ID = "user_id";
	public static final String CREATION_DATE = "creation_date";
	
	private SQLiteDatabase db;
	
	private static HistoryDAO instance = new HistoryDAO();
	
	public static HistoryDAO getInstance(Context context){
		
		if (instance.db == null || !instance.db.isOpen()) {
			DBHelper helper = new DBHelper(context);
			instance.db = helper.getWritableDatabase();
		}
		return instance;
	}
	
	public HistoryDAO() {
		// TODO Auto-generated constructor stub
	}
	
	

}
